<?php
class CommonAction extends Action {	
	protected $admin =  array(); // 当前请求类型
	protected static $acl = null;
	public function _initialize()
	{
	
    Load('extend');
   	//import("@.ORG.Page"); //导入分页类      
     if(!D('User')->hasSignin()) { // 检测用户是否登录
			$this->error('请登录',U('Public/login'));
		}
        
   $this->admin =  session('_LOGIN_');
   Vendor('Zend.Acl');
   self::$acl = new Zend_Acl();
   $rolelist= D('User')->getRoleList();
   $reslist= D('User')->getResourceList();

   foreach($rolelist as $role){
  	  self::$acl->addRole(new Zend_Acl_Role($role['id']));
   }

   self::$acl->add(new Zend_Acl_Resource('testR'));
   self::$acl->allow('6', 'testR');
       
   
	}
	
   	
 
	
}